{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "Decision Trees for Regression"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0xaaead68>"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAEACAYAAABI5zaHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAFYNJREFUeJzt3V2MJFd5xvHn9a49xrbkHSvxthQnHiKE+EjQJJFQJBOl\nJcCxchEjX0QLuWCcj6sQULiITbjYKMoFRoolpISbsGQNElohZGFzhYngXDgIsMAbG1gcR7A2EHZA\nsEkwSCubPbnoGs9Hd3V116nut86p/09qefpUV9czNTOvZ56ZrrUYowAAZbnGOwAAoHsMdwAoEMMd\nAArEcAeAAjHcAaBADHcAKFDjcDez28zs82b2DTN72szeXa1vmtljZvaMmX3WzG5efVwAwCKs6e/c\nzWwkaRRjPG9mN0n6qqS7Jd0r6ccxxg+a2X2SNmOM9688MQCgUeN37jHGSzHG89XbL0i6IOk2TQb8\nQ9XDHpL0tlWFBAAsp/E790MPNtuSFCT9hqTvxhg3D2z7SYzxlo7zAQBaWPgXqlUl8ylJ76m+gz/6\nfwWuYwAAPXF8kQeZ2XFNBvvHY4yPVMu7ZnYyxrhb9fI/rNmXoQ8ALcQYre2+i37n/lFJ34wxfujA\n2qOSdqq33ynpkaM77YkxZns7ffq027Grszfjtvg59cyf87knP/m9b6kav3M3szsk/Ymkp83syWq6\n/K2kByR90sz+VNJzkv44OU0PXbx40TtCkpzz55xdIr+33POnahzuMcZ/l3SsZvNbuo0DAOgCr1Bt\nsLOz4x0hSc75c84ukd9b7vlTLfWnkK0OYBZXfYxSmZlm/xGSddL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5XT+p/Lncv7N7Jf2Kgsze4Wkt2rye4Mszn9N/m91ev5X+Jvg\nuzT5Dfyzku73/K30gnlfqclf9TypyVC/v1q/RdK/Ve/LY5JOeGc9kPkTkv5bk3/V93lJ90rarMsr\n6X2a/Jb9gqQ7e5r/Y5Keqj4Wn9akQ+1dfkl3SPrFgc+Zr1Wf87WfL5nkz+X8/2aV+XyV9/3Vei7n\nvy5/Z+efFzEBQIH4hSoAFIjhDgAFYrgDQIEY7gBQIIY7ABSI4Q4ABWK4A0CBGO4AUKD/B9qKTNF3\nkA3VAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xaad5278>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#Use within an Jupyter notebook\n",
    "%matplotlib inline   \n",
    "\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "from sklearn.datasets import load_diabetes\n",
    "\n",
    "diabetes = load_diabetes()\n",
    "\n",
    "X = diabetes.data\n",
    "y = diabetes.target\n",
    "\n",
    "X_feature_names = ['age', 'gender', 'body mass index', 'average blood pressure','bl_0','bl_1','bl_2','bl_3','bl_4','bl_5']\n",
    "\n",
    "pd.Series(y).hist(bins=50)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0xaec9668>"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAEACAYAAABI5zaHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAFrxJREFUeJzt3W+MpWV9xvHvhVssaGG3Nuy0bmRApWITOmoFE2x6Kn9E\nTcEXTUWtZWhi02iDMQ1hoS+oL5Q/SUNMW18YkVka8B+NARsqSOA2Q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RHy8dpEuSfkPS8c3HxwDnAFX8oBggIq6IiFdE\nxMnAhcDdEfFnpXN1RdKxzXeUSHoJcC7wvbKpuhMRK8BBSac0p84C9haMlMu7GVHJQIHXlpF0M8M/\nlfIySY8BV67+AKQGks4E3gs81HTTAVwREV8um6wTvwnsaX5SfxTwuYi4vXAmG99O4IvNS39sA26K\niDsLZ+raJcBNTXXxQ+Diwnk6JelYhj9M/YuR1/UvMZmZ1cedu5lZhbzczcwq5OVuZlYhL3czswp5\nuZuZVcjL3cysQl7uZmYV8nI3M6vQ/wP3XLGU/JuWKgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x3e7f518>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "bins = 50*np.arange(8)\n",
    "binned_y = np.digitize(y, bins)\n",
    "\n",
    "pd.Series(binned_y).hist(bins=50)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from sklearn.model_selection import train_test_split\n",
    "\n",
    "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2,stratify=binned_y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "66.831460674157299"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.tree import DecisionTreeRegressor\n",
    "\n",
    "dtr = DecisionTreeRegressor()\n",
    "dtr.fit(X_train, y_train)\n",
    "y_pred = dtr.predict(X_test)\n",
    "\n",
    "from sklearn.metrics import mean_absolute_error\n",
    "mean_absolute_error(y_test, y_pred)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.62441493259946346"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(np.abs(y_test - y_pred)/(y_test)).mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0xcd54438>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAEACAYAAACj0I2EAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAFaxJREFUeJzt3X+MZXdZx/H3s912pbQw2yCzQGFHRUSNOJTwI2LiDT9X\nDS1ZTdyiwcHEv5QSQhAIaMUYBBOVJkaiERk0wibWVUD5HTwQQKDSHVqg1Cpuy68dNV3AWoNIH/+4\nd/fendmZnXvOPXPu+c77lUz2nnPPved59pz77J3P/bGRmUiS+m9f1wVIkmbDgS5JhXCgS1IhHOiS\nVAgHuiQVwoEuSYWYeqBHxEsj4rMRcVtE/GVEXNZGYZKk6Uw10CPikcCLgWsy8wnAfuBYG4VJkqaz\nv8ZtLgEeHBEPAJcDX51tSZKkOqZ6hp6ZXwV+D7gH+Arw9cz8YBuFSZKmM23ksgBcBxwGHglcEREv\naKMwSdJ0po1cngV8MTPvBYiIE8CPAW+b3Cgi/IIYSaohM6Pubad9l8s9wNMi4rsiIoBnAndsUVSx\nPzfeeGPnNZTS3+hs2fDT3vkzy952u/Z5O3b2N/ufpqbN0D8F3AycBD4DBPAnjavomVOnTnVdQqtK\n7q/k3sD+9rqp3+WSma8FXttCLZKkBvykaA0rKytdl9CqkvsruTewv70uZpHbbLrTiGzjflWe4Usx\nG8+VmEme2LY+1675FBHkLr4oKqCqqq5LaFXJ/ZXcG9jfXudAl6RCGLmoU32OLfpcu+aTkYskCXCg\n11J6jldyfyX3Bva31znQJakQZujqVJ9z6D7Xrvlkhi5JAhzotZSe45XcX8m9gf3tdQ50SSqEGbo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\nB3MqIo4ALweuzcxvTVxVRH8bTOboJfZ3C/DYiDgcEZcBxxj22UfB5uO1Mrr8i4yPyQWP424VWdOf\nAZ/PzJsm1hXRX0Q87Ow7WGL4nSLPZvg6wez6a/iK7c3AbQzfMfAO4BET172K4auydwDPmVj/JOB2\nhgH/TV2/6nyR/u4C7gZuHf38UWH9PZ9hRvc/DD/5+56S+rtAv0cYvnPiLuCVXddTs4e3AV8FvgXc\nA7wIOAh8cNTb+4GFix3HefwBng58ZzRPTo4ec0eAqwrp70dGPa2N5uarR+tn1p8fLJKkQvhf0ElS\nIRzoklQIB7okFcKBLkmFcKBLUiEc6JJUCAe6JBXCgS5Jhfh/aKuB5Gypr20AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xcbacf28>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "pd.Series((y_test - y_pred)).hist(bins=50)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0xcf05908>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXEAAAEACAYAAABF+UbAAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAE45JREFUeJzt3X2sZHV9x/HPd70gbC3ehcad1BsZqaFWBK9E0IammUoI\nlJaHbkyzkj5cbZraCppqCI/pWmMMkFbX2PqHSvdq42a1uH0grQQJPTRUiVi4PChQSLs8WBkDLC5m\n44Z1v/1j5rJ3597Zc87MmfM73zvvVzLZPWfOzPnszOXLuZ85M2PuLgBATBtSBwAAjI4hDgCBMcQB\nIDCGOAAExhAHgMAY4gAQWO4QN7ObzaxrZg+uWHeTmT1iZktm9nUzO2GyMQEAaylyJL5D0vkD626X\ndJq7z0t6XNI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HwCIi69nA4DAGOIAEBhDHAACY4gDQGAMcQAIjCEOAIExxAEg\nMIY4AAT2//urmCcHt3jIAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xc96ed30>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "pd.Series((y_test - y_pred)/(y_test)).hist(bins=50)"
   ]
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
